{% load i18n %}

<li id="comment-{{ comment.id }}">
	<div class="comment">
		<div class="comment_header" {% ifequal alternate 1 %}style="background-color: #EBF0F5;"{% endifequal %}>
			<table>
				<tbody>
					<tr>
						<td class="comment_header_avatar">
							{% if comment.user %}
							<a class="avatar" href="{{ comment.user.bloginfo.get_absolute_url }}" target="_blank">
								<img src="/site_media/{{ comment.user.get_profile.image_url }}" width="32" height="32"> 
							</a>
							{% else %}
								{% if comment.user_url %}
							<a class="avatar" href="{{ comment.user_url }}" target="_blank">
								<img src="/senbzblog/static/images/default_user_picture.png" width="32" height="32"> 
							</a>
								{% else %}
							<img src="/senbzblog/static/images/default_user_picture.png" width="32" height="32">
								{% endif %}
							{% endif %}
						</td>
						<td class="comment_header_meta">
							<div class="comment_header_meta_wrapper">
								{% if comment.user %}
								<a href="{{ comment.user.bloginfo.get_absolute_url }}" target="_blank">
									<b class="comment_header_username">{{ comment.user_name }}</b></a>
								{% else %}
									{% if comment.user_url %}
								<a href="{{ comment.user_url }}" target="_blank">
									<b class="comment_header_username">{{ comment.user_name }}</b></a>
									{% else %}
								<b class="comment_header_username">{{ comment.user_name }}</b>
									{% endif %}
								{% endif %}
								<span> 
									{{ comment.submit_date|date:"Y-m-d H:i" }}
								</span> 
							</div>
						</td>
					</tr>
				</tbody>
			</table>
		</div>
		<div class="comment_body">
			{{ comment.comment }}
		</div>
		<div class="comment_footer">
			<button id="show_comment_reply_{{ comment.id }}" type="button" class="comment_button_small"
				 onclick="senbz.comment.show_reply(this.id, 'comment_reply_{{ comment.id }}')">Reply</button>
		</div>
	</div>
	<div id="comment_reply_{{ comment.id }}" class="comment_append_post" style="display: none;">
		<form action="{{ object.get_post_comment_url }}" method="post" 
			onsubmit="return senbz.validator.check_comment('user_name_{{ comment.id }}','user_email_{{ comment.id }}', 'comment_{{ comment.id }}')">
			{% if nexturl %}
		  	<div><input type="hidden" name="nexturl" value="{{ nexturl }}#comment-{{ comment.id }}" /></div>
		  	{% endif %}
		  	<div>
			  	{{ commentform.content_type }}
			  	{{ commentform.object_pk }}
			  	{#{{ commentform.parent_id }}#}
			  	{{ commentform.pertain }}
			  	<input type="hidden" name="parent_id" value="{{ comment.id }}" id="parent_id">
		  	</div>
			<div class="comment_post_area">
				<h3 style="margin-top: 0px">{% trans "Replying to" %} {{ comment.user_name }}</h3>
				<div class="textarea_wrapper">
					<textarea id="comment_{{ comment.id }}" name="comment"></textarea>
				</div>
				<div class="dsq-post-footer">
					<div class="textarea_wrapper" style="float: left; margin-right: 10px;">
						<label for="user_name_{{ comment.id }}" class="small">{% trans "Name" %}<span class="red">*</span> </label>
						<input id="user_name_{{ comment.id }}" type="text" name="user_name" maxlength="30" style="width: 140px;">
					</div>
					<div class="textarea_wrapper" style="float: left;">
						<label for="user_email_{{ comment.id }}" class="small">{% trans "Email address" %}<span class="red">*</span> </label>
						<input id="user_email_{{ comment.id }}" type="text" name="user_email" maxlength="30" style="width: 140px;">
					</div>
					<button type="submit" class="comment_button">{% trans "Reply" %}</button>
					<button type="button" class="comment_button"
						onclick="senbz.comment.show_reply('show_comment_reply_{{ comment.id }}', 'comment_reply_{{ comment.id }}')">Cancel</button>
				</div>
				<div style="clear:both"></div>
			</div>
		</form>
	</div>
</li>
